<?php
namespace app\modules\admin\models;
use yii\db\ActiveRecord;

class Banner extends ActiveRecord
{
    public static function tableName()
    {
        return 'Banner';
    }
    public function scenarios()
    {
        return [
            'bannerAdd' => ['img','title'],
            'bannerModify' => ['img','title'],
        ];
    }
    public function rules()
    {
        return [
            [['img'],'required','message'=>'内容不能为空','on'=>['bannerAdd','bannerModify']],
        ];
    }
}